/**********************************************
R E A D M E _ R U N_ A N A L Y S I S. D O

**********************************************/
* set up;
#delimit;
clear all;
cls;
set more off;

global output "../";

************************************
**** Commands needed;
************************************;
	*eststo;
	*ivreg2 ;
	* ssc install ranktest;
	*ssc install reghdfe;
	*ftools ;
	*ssc install erepost;
	*ssc install  ssc install  binscatter;
	*ssc install parmest;
	*ssc install heatplot;
	*ssc instal labutil ;//labmask
	*ssc install palettes, replace;
	*ssc install colrspace, replace;
	*Scheme for figures;
	adopath + "scheme";  
	     *(The scheme in this folder would allow you to create the graphs using the same scheme that we use for the 	figures in the paper);
	set scheme MTU ;
	     *This is the graph scheme saved in the folder "scheme" and that we use for our graphs.;
****************************************;

*---------------------------------;
* Figures ;
*---------------------------------;


*- Figure 1, Table 1 and Figure 4 ; 
if 1==1{;
	do "surface_type";
	do "Trends_figures.do";
};





* - Table 2, Appendix Figure B1;
if 1==1{;
	do "sample_regressions.do";
	};
	
	
	* sample composition regressions;
if 1==1{;
	do "sample_composition.do";
	};




*- Table 3, Appendix Table B2;
if 1==1{;
	do "universe_regressions.do";
};


* Appendix Table B3: universe composition regressions;
if 1==1{;
	do "universe_composition.do";

	};

	
*Appendix Figure B2 ; 
if 1==1{;		
	do "Resurfacing_events";
	
};

* Appendix Figure B3;
if 1==1{;
	do "universe_maint.do";
	};


*Optimatily conditions-Calibration ; 
if 1==1{;		
	do "Create_national_vars.do";
	do "optimality_contidions.do";
	
};

*Appendix Figure A1: compare MTU BL; 
if 1==1{;
	do "compare_MTU_BL.do";
};






do "appendix_table.do";
	
*shell pdflatex -synctex=1 -interaction=nonstopmode "Figures_Tables_draft.tex";
*This step allows you to create a PDF with the figures of the paper. To run it you would have to make sure that 
*your .tex configurations includes all the necesary packages and that you can call pdflatex directly from the command line.;

exit;
